#!/usr/bin/env python3

import sys, json, os, operator, functools
from common import fget, fset, anonify

def configure ():
    settings = anonify(json.loads(fget("settings.json")))
    settings["vstring"] = fget("vstring")
    settings_javafile_fmt = fget("Settings.java.fmt")
    fset("Settings.java", settings_javafile_fmt.format(**settings))

def files ():
    print("Settings.java")

def main (argv0, argv):
    if argv and argv[0] == "files":
        files()
    else:
        configure()

if __name__ == "__main__":
    try:
        sys.exit(main(sys.argv[0], sys.argv[1:]))
    except KeyboardInterrupt:
        pass
